'''
数据嵌套
列表套列表
格式：[[],[],[]...]
'''
# listA = [['刘备','关羽','张飞'], # 0
#          ['王大锤','蔡徐坤'], # 1
#          ['刘亦菲','柳岩']] # 2
# # 打印王大锤
# #print(listA[1])
# #['王大锤', '蔡徐坤']
# #print(listA[1][0])
# # 王大锤
# # 打印柳岩
# a = listA[2]
# print(a[1])
# # 打印蔡徐坤
# b = listA[1]
# print(b[1])

# 列表套字典
#格式；listB = [{},{},{}...]
# list_girls = [
#     {'姓名':'柳岩','年龄':'35','爱好':'跳舞'}, # 0
#     {'姓名':'范冰冰','年龄':'37','爱好':'唱歌'}, # 1
#     {'姓名':'王心凌','年龄':'39','爱好':'玩游戏'}, # 2
#     {'姓名':'刘亦菲','年龄':'36','爱好':['看电影','打豆豆','吃零食']}, # 3
# ]
# #打印范冰冰的爱好
# print(list_girls[1]['爱好'])
# #打印王心凌的年龄
# print(list_girls[2]['年龄'])
# #打印刘亦菲的爱好
# print(list_girls[3]['爱好'])
# #修改王心凌的爱好为玩手机
# list_girls[2]['爱好']='玩手机'
# print(list_girls[2])

dict_info = {
    'code':200,
    'msg':'success',
    'date': [{'name':'王大锤','score':66},
            {'name':'王心凌','score':78},
            {'name':'王宝强','score':58},
            {'name':'王思聪','score':45},
            {'name':'王一博','score': 76},
             ]
}
# 打印code的值
print(dict_info['code'])
#打印王思聪的考试成绩
a = dict_info['date']
print(a[3]['score'])
# 打印所有的名字
print(dict_info['date'])
for n in dict_info['date']:
    print(n['name'])
#打印所有的成绩

#打印所有的成绩及格的名字





